home *** CD-ROM | disk | FTP | other *** search
/ Champak 132 (Alt) / Vol 132.iso / games / 3d_hyper / 3d_hyper.dcr / Scripts_52_Speedometer Stuff.ls < prev    next >
Encoding:
Text File  |  2011-06-09  |  603 b   |  17 lines

  1. global gSpeedometerInfo, gCurrentVel, gCamera, gSpriteScale
  2.  
  3. on updateSpeedometer
  4.   theSpeed = gCurrentVel.magnitude
  5.   maxSpeed = 1600.0
  6.   propSpeed = theSpeed / maxSpeed
  7.   theDegree = (180 * propSpeed) - 90
  8.   if theDegree > 95 then
  9.     theDegree = 95
  10.   end if
  11.   radTurn = theDegree * (PI / 180)
  12.   leftAmount = 64 * sin(radTurn) * 0.80000000000000004 * gSpriteScale
  13.   upAmount = 64 * -cos(radTurn) * 0.80000000000000004 * gSpriteScale
  14.   gCamera.overlay[gSpeedometerInfo.num].rotation = theDegree
  15.   gCamera.overlay[gSpeedometerInfo.num].loc = gSpeedometerInfo.centerLoc + point(leftAmount, upAmount)
  16. end
  17.